type variable =
  BnType.variable = {
  vname : string;
  idx : int;
  range : int;
  valnames : string array;
}
type cpnode =
  BnType.cpnode =
    Leaf of float array
  | Vertex of int * int * cpnode * cpnode
type cpd =
  BnType.cpd =
    Table of float array array
  | Tree of cpnode
  | FactorSet of Mn.Factor.factor list
type network =
  BnType.network = {
  name : string;
  mutable acyclic : bool;
  vars : variable array;
  parents : int list array;
  dists : cpd array;
  children : int list array;
  name_to_varidx : (string, int) Ext.Hashtbl.t;
  name_to_validx : (string, int) Ext.Hashtbl.t array;
  topo_vars : variable array;
}
val get_range : network -> int -> int
val num_values : network -> int -> int
val schema : network -> int array
val tree_params : cpnode -> int
val dist_params : cpd -> int
val create_var : int -> int -> variable
val create_default_cpt : variable -> cpd
val build_namehashes :
  variable array ->
  (string, int) Ext.Hashtbl.t * (string, int) Ext.Hashtbl.t array
val make_children : int list array -> int list array
val make_topo_vars :
  variable array -> 'a list array -> int list array -> variable array
val create_empty_network : int array -> network
val update_children_and_topo_vars : network -> unit
val set_cpt : network -> int -> int list -> float array array -> unit
val bitvector_to_list : bool array -> int list
val factorset_parents : int -> int -> Mn.Factor.factor list -> int list
val tree_parents : int -> cpnode -> int list
val set_cptree : network -> int -> cpnode -> unit
val set_factorset : network -> int -> Mn.Factor.factor list -> unit
val state_to_pidx : network -> int -> int array -> int
val tree_to_factor : Mn.Factor.variable -> cpnode -> Mn.Factor.tree
val table_to_factor : 'a -> 'b -> 'c -> 'd array array -> 'd array
val cpd_to_factors :
  network -> Mn.Factor.variable -> cpd -> Mn.Factor.factor list
val to_mn : network -> Mn.network
val numvars : network -> int
val varname : network -> int -> string
val idx : variable -> int
val parents : network -> int -> int list
val children : network -> int -> int list
val numparents : network -> int -> int
val numchildren : network -> int -> int
val numparams : network -> int -> int
val simplify_node : int -> int array -> cpnode -> cpnode
val simplify : network -> Mn.Factor.varvalue array -> network
val tree_logprob : int array -> cpnode -> float array
val cond_logprob : network -> Mn.Factor.varvalue array -> int -> float array
val node_logscore : network -> Mn.Factor.varvalue array -> int -> float
val mb_logprob : network -> Mn.Factor.varvalue array -> int -> float array
val mb_prob : network -> Mn.Factor.varvalue array -> int -> float array
val cond_prob : network -> Mn.Factor.varvalue array -> int -> float array
val loglikelihood : network -> Mn.Factor.varvalue array -> float
val pll : network -> Mn.Factor.varvalue array -> float
val sample_array : float array -> int
val sample : network -> Mn.Factor.varvalue array
val load_bif : in_channel -> BnType.network
val load_xmod : in_channel -> BnType.network
val load_cn : in_channel -> BnType.network
val output_bif : out_channel -> BnType.network -> unit
val output_xmod : out_channel -> BnType.network -> unit
val output_cn : out_channel -> BnType.network -> unit
val filename_is_xmod : string -> bool
val filename_is_bif : string -> bool
val filename_is_cn : string -> bool
val filename_is_dn : string -> bool
val load_auto : string -> BnType.network
val write_auto : string -> BnType.network -> unit
